package com.artPreter.controller;


import com.artPreter.pojo.EventExhibitionSectionTemp;
import com.artPreter.pojo.Result;
import com.artPreter.service.IEventExhibitionSectionTempService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 活动展览栏目表 前端控制器
 * </p>
 *
 * @author jarvis
 * @since 2025-01-07
 */
@RestController
@RequestMapping("/eventExhibitionSectionTemp")
public class EventExhibitionSectionTempController {

    @Autowired
    private IEventExhibitionSectionTempService eventExhibitionSectionTempService;

    /**
     * 添加机构栏目
     * @param
     * @return
     */
    @PostMapping("/add")
    public Result add(@RequestBody EventExhibitionSectionTemp eventExhibitionSectionTemp) {
        eventExhibitionSectionTempService.add(eventExhibitionSectionTemp);
        return Result.success();
    }

    /**
     * 删除机构栏目
     * @param
     * @return
     */
    @PostMapping("/delete")
    public Result delete(@RequestBody EventExhibitionSectionTemp eventExhibitionSectionTemp) {
        eventExhibitionSectionTempService.delete(eventExhibitionSectionTemp);
        return Result.success();
    }

    /**
     * 批量机构保存栏目
     * @param eventExhibitionSectionTempList
     * @return
     */
    @PostMapping("/saveBatch")
    public Result saveBatchData(@RequestBody List<EventExhibitionSectionTemp> eventExhibitionSectionTempList) {
        eventExhibitionSectionTempService.saveBatchData(eventExhibitionSectionTempList);
        return Result.success();
    }

    /**
     * 获取机构栏目列表
     * @param eventExhibitionSectionTemp
     * @return
     */
    @PostMapping("/getList")
    public Result getList(@RequestBody EventExhibitionSectionTemp eventExhibitionSectionTemp) {
        List<EventExhibitionSectionTemp> list = eventExhibitionSectionTempService.getList(eventExhibitionSectionTemp);
        return Result.success(list);
    }

}
